#lesson2-3

#多分支结构
#语句语法
'''
if 条件表达式1：
    语句块1
elif 条件表达式2：
    语句块2

……
elif 条件表达式n：
    语句块n
else:
    语句n+1

'''


#第一个实例:计算分段函数
'''x = float(input("请输入x："))
if x > 1:
   y = x
elif x < -1:
    y = -x
else:
    y = 1
print("y的结果为：%f"%y)

'''


#第二个实例成绩判断
'''
mark = float(input("请输入分数："))
if mark > 100:
    print("请输入正确的分数！")
elif 100 >= mark >= 90:
    print("优秀")
elif 90> mark >=80:
    print("良")
elif 80 > mark >= 70:
    print("中等")
elif 70 > mark >= 60:
    print("及格")
else:
    print("不及格!")
    
'''

#第三个实例成绩判断
'''
mark = float(input("请输入分数："))
if mark > 100:
    print("请输入正确的分数！")
elif mark >= 90:
    print("优秀")
elif mark >= 80:
    print("良")
elif mark >= 70:
    print("中等")
elif mark >= 60:
    print("及格")
else:
    print("不及格!")
    
'''

#第四个实例成绩判断
'''
mark = float(input("请输入分数："))
if mark > 100:
    panduan = "请输入正确的分数！"
elif mark >= 90:
    panduan = "优秀"
elif mark >= 80:
    panduan = "良"
elif mark >= 70:
    panduan = "中等"
elif mark >= 60:
    panduan = "及格"
else:
    panduan = "不及格"
print(panduan)

'''

#第五个实例象限判断

x = float(input("请输入x的值："))
y = float(input("请输入y的值："))
if x > 0 and y > 0:
    xx = "第一象限"
elif x > 0 and y < 0:
    xx = "第四象限"
elif x < 0 and y > 0:
    xx = "第二象限"
elif x == 0:
    xx = "在y轴上"
elif y == 0:
    xx = "在x轴上"
elif y == 0 and x == 0:
    xx = "在原点上"
else:
    xx = "第三象限"
print(xx)



